﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using XamarinAndroidSample.Model;
namespace XamarinAndroidSample.WebApi.DAL
{
    public class Employee
    {
        public static EmployeeModel GetEmployee(int id)
        {
            EmployeeModel result = null;
            try
            {
                result = new EmployeeModel();
                string sql = "select * from   Employee  where  id = " + id;
                DataRow  row= SqlHelper.GetInstance().getRowObj(sql);
                result.Id = int.Parse(row["Id"].ToString());
                result.UserName = row["UserName"].ToString();
                result.PassWord= row["PassWord"].ToString();
                return result;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
        }
    }
}
